<?php
namespace app\common\validate;
use think\Validate;
class User extends Validate {
    protected $rule = [
        ['id','number'],
        ['username','require|max:20','用户名必须填写|用户名不能超过20个字符'],
        ['passowrd','require','密码必须填写'],
        ['repassowrd','require','确认密码必须填写'],
        ['email','require','邮箱必须填写'],
        ['mobile','require','联系电话必须填写'],
        ['listorder','number'],
        ['status','number|in:-1,0,1','状态必须是数字|状态范围不合法'],
    ];

    // 场景设置
    protected  $scene = [
        'add' => ['username', 'password','email','id'],
        'update' => ['username','email','id'],
        'login' => ['username','password'],
        'listorder'=>['id','listorder'],
        'status' =>['id','status'],
    ];
}